<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>libnetconf: NETCONF library - libnetconf</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="cesnet-logo-125.png"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">libnetconf
   &#160;<span id="projectnumber">0.1.1</span>
   </div>
   <div id="projectbrief">NETCONF library</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.8.0-20120409 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li class="current"><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('index.html','');
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">NETCONF library - libnetconf </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>This documents provides documentation of the NETCONF library (libnetconf).</p>
<h2>CLIENT WORKFLOW</h2>
<p>Here is a description of using libnetconf functions in a NETCONF client:</p>
<ol type="1">
<li><b>Set verbosity (optional)</b>.<br/>
 The verbosity of the libnetconf can be set by <a class="el" href="d3/d35/group__gen_a_p_i.html#gadd8fd7b3bb2e7cba580c9a4229fe02d7" title="Set libnetconf&#39;s verbosity level.">nc_verbosity()</a>. By default, libnetconf is completely silent.<br/>
 There is a default message printing function writing messages on the stderr. The application's specific message printing function can be set via <a class="el" href="d3/d35/group__gen_a_p_i.html#gadd495650e5d752712e285fd61c87362e" title="Set callback function for printing libnetconf&#39;s messages.">nc_callback_print()</a> function.</li>
<li><b>Set SSH authentication methods priorities (optional)</b>.<br/>
 libnetconf supports several SSH authentication methods for connecting with a NETCONF server over SSH. However, the used method is selected from the list of supported authentication methods provided by the server. Client is allowed to specify the priority of each supported authentication method via <a class="el" href="db/d52/group__session.html#ga13119fdaa84544bf254bdb35ffdf83e0" title="Set preference of the SSH authentication methods.">nc_ssh_pref()</a> function. The authentication method can be also disabled using a negative priority value.<br/>
 Default priorities are as following:<ul>
<li><em>Interactive</em> (value 3)</li>
<li><em>Password</em> (value 2)</li>
<li><em>Public keys</em> (value 1)</li>
</ul>
</li>
<li><b>Set own callback(s) for the SSH authentication methods (optional)</b>.<br/>
 User credentials are get via callback functions specific for each authentication method. There are default callbacks, but application can set their own via:<ul>
<li><em>Interactive</em> - <a class="el" href="db/d52/group__session.html#gacb6042fe2f3cfe5d79e01de599c546eb" title="Set callback function for passing user credentials into libssh2&#39;s keyboard-interactive authentication...">nc_callback_sshauth_interactive()</a></li>
<li><em>Password</em> - <a class="el" href="db/d52/group__session.html#ga28299d575ef4e234ed96bad5c4f086fb" title="Set callback function for passing user password into libssh2&#39;s password authentication method when co...">nc_callback_sshauth_password()</a></li>
<li><em>Publuc keys</em> - <a class="el" href="db/d52/group__session.html#ga81ef9b1c1949bbffd86cbfd9aa159726" title="Set callback function for passing user password into libssh2&#39;s publickey authentication method when c...">nc_callback_sshauth_passphrase()</a>. Here, also paths to the key files can be specified by <a class="el" href="db/d52/group__session.html#gae521c81f448de075a84f62388320ebae" title="Set path to publickey file used in case of SSH authentication via publickey mechanism.">nc_set_publickey_path()</a> and <a class="el" href="db/d52/group__session.html#ga66beddc668fcc5c3699165bf3d3fd089" title="Set path to privatekey file used in case of SSH authentication via publickey mechanism.">nc_set_privatekey_path()</a>. If not set, libnetconf tries to find them in default paths.</li>
</ul>
</li>
<li><b>Connect to the NETCONF server(s)</b>.<br/>
 Simply call <a class="el" href="db/d52/group__session.html#gae3858d998d19cb2fb700b15fdf602f23" title="Create NETCONF session to the specified server.">nc_session_connect()</a> to connect to the specified host via SSH. Authentication method is selected according to default values or previous steps.</li>
<li><b>Prepare NETCONF rpc message(s)</b>.<br/>
 Creating NETCONF rpc messages is covered by functions described in section <a class="el" href="db/de9/group__rpc.html">NETCONF rpc</a>. Application prepares NETCONF rpc messages according to specified attributes. These messages can be then repeatedly used for communication over any of the created NETCONF sessions.</li>
<li><b>Send the message to the selected NETCONF server</b>.<br/>
 To send created NETCONF rpc message to the NETCONF server, use <a class="el" href="db/de9/group__rpc.html#ga9a4b99f1ccfbf736f35730ea45bed8dc" title="Send &lt;rpc&gt; request via specified NETCONF session. This function is supposed to be performed only by N...">nc_session_send_rpc()</a> function. <a class="el" href="db/de9/group__rpc.html#ga53db624265a53d44d597c9ac7df74259" title="Send &lt;rpc&gt; and receive &lt;rpc-reply&gt; via the specified NETCONF session.">nc_session_send_recv()</a> function connect sending and receiving the reply (see next step) into one blocking call.</li>
<li><b>Get the server's rpc-reply message</b>. When the NETCONF rpc is sent, use <a class="el" href="d0/de2/group__reply.html#ga53fec7353656b7e9c7ca4742149dced0" title="Receive &lt;rpc-reply&gt; response from the specified NETCONF session. This function is supposed to be perf...">nc_session_recv_reply()</a> to receive the reply. To get know when the reply is coming, file descriptor of the communication channel can be checked by poll(), select(), ... This descriptor can be obtained via <a class="el" href="db/d52/group__session.html#ga826890ed745633bc2d31a53971dada32" title="Get input file descriptor to asynchronous control of input events.">nc_session_get_eventfd()</a> function.</li>
<li><b>Close the NETCONF session</b>.<br/>
 When the communication is finnished, the NETCONF session is closed by <a class="el" href="db/d52/group__session.html#ga20b9940ed7af543a05b4bef6e871cedd" title="Close NETCONF connection with the server.">nc_session_close()</a> and all used structures are freed by <a class="el" href="db/d52/group__session.html#gaa5994f45a7031dc931bdf4a3acebedee" title="Cleanup the session structure and free all allocated resources.">nc_session_free()</a>.</li>
<li><b>Free all created objects</b>.<br/>
 Do not forget to free created rpc messages (<a class="el" href="db/de9/group__rpc.html#ga4041bda37caa9eedb7a1e2534280f3df" title="Free rpc message.">nc_rpc_free()</a>), <a class="el" href="db/de9/group__rpc.html#ga3212b7af605b6bdf83b893979c3bcc79">filters</a> (<a class="el" href="db/de9/group__rpc.html#ga0dbfd598d6fd303819817370cdf63229" title="Destroy filter structure.">nc_filter_free()</a>) or received NETCONF rpc-replies (<a class="el" href="d0/de2/group__reply.html#ga17aa9f38d7b75dec1a57b478b0b39710" title="Free reply message.">nc_reply_free()</a>).</li>
</ol>
<h2>GLOSSARY</h2>
<ul>
<li><b>message</b> - all types of messages passing through the NETCONF. It includes rpc, rpc-reply and notification. </li>
</ul>
</div></div><!-- contents -->
</div>
  <div id="nav-path" class="navpath">
    <ul>

    <li class="footer">Generated on Fri Aug 3 2012 08:25:37 for libnetconf by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.0-20120409 </li>
   </ul>
 </div>


</body>
</html>
